<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://paycn.com.cn/pos" prefix="p"%>

<div class="container-fluid" >
	<div class="row-fluid">
		<div class="span12">
			<h3 class="page-title">登陆日志</h3>
			<ul class="breadcrumb">
				<li>
					<i class="icon-home"></i>
					<a href="<c:url value="/home.html"/>">首页</a>
					<i class="icon-angle-right"></i>
				</li>
				<li><a href="#">登陆日志</a></li>
			</ul>
		</div>
	</div>
	<div class="row-fluid" >
		<div class="span12">
			<div class="portlet">
				<div class="portlet-title">
					<div class="caption"><i class="icon-search"></i>查询</div>
					<div class="tools">
						<a class="collapse" href="javascript:;"></a>
					</div>
				</div>
				<div class="portlet-body" >
					<form class="form-inline">
						<div class="row-fluid">
							<div class="span2 query">
								<div class="control-group">
									<label class="control-label">用户名</label>
									<div class="controls">
										<input type="text" name="username" class="m-wrap span12">
									</div>
								</div>
							</div>
							<div class="span2 query">
								<div class="control-group">
									<label class="control-label">状态</label>
									<div class="controls">
										<select name="status" class="span12 m-wrap">
											<option value="">-</option>
											<option value="success">登陆成功</option>
											<option value="fail">登陆失败</option>
										</select>
									</div>
								</div>
							</div>
							<div class="span2 query">
								<div class="control-group">
									<label class="control-label">&nbsp;</label>
									<div class="controls">
										<button type="submit" class="btn blue purple-stripe"><i class="icon-search"></i> 查询</button>
									</div>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>	
	<div class="row-fluid">	
		<div class="span12">
			<div class="portlet box grey">
				<div class="portlet-title">
					<div class="caption"><i class="icon-bookmark"></i>用户</div>
					<div class="actions">
						
					</div>
				</div>
				<div class="portlet-body no-more-tables">
					<table class="table  table-bordered table-striped table-hover">
						<thead>
							<tr>
								<th>用户名</th>
								<th>状态</th>
								<th>登陆ip</th>
								<th>登陆日期</th>
								<th>Agent</th>	
							</tr>
						</thead>
						<tbody>
							<c:forEach var="loginLog" items="${datagrid.rows}">
								<tr>
									<td data-title="用户名">${loginLog.username}</td>
									<td data-title="状态">
										<c:choose>
											<c:when test="${loginLog.status eq \"success\"}"><span class="label label-info">登陆成功</span></c:when>
											<c:when test="${loginLog.status eq \"fail\"}"><span class="label label-important">登陆失败</span></c:when>
											<c:otherwise>${loginLog.status}</c:otherwise>
										</c:choose>
									</td>
									<td data-title="登陆ip">${loginLog.ip}</td>
									<td data-title="登陆日期"><fmt:formatDate value="${loginLog.loginDate}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
									<td data-title="Agent">${loginLog.agent}</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<p:pagination url="/loginLog/list.html" total="${datagrid.total }"/>
				</div>
			</div>
		</div>
	</div>
</div>
